home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Selection.h
-
- Contains: Selection class implementation
-
- Written by: Steve Smith
-
- Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- */
-
- #ifndef _SELECTION_
- #define _SELECTION_
-
- // -- Compiler/Preprocessor Switches --
-
- #ifndef _COMPILERDEFS_
- #include "CompDefs.h"
- #endif
-
- // -- PanelEditor Includes --
-
- #ifndef _SAMPLECOLLECTIONS_
- //#include "SampleCollections.h"
- #endif
-
- #ifndef _LISTITEM_
- //#include "ListItem.h"
- #endif
-
- #ifndef _UNDOPE_
- //#include "UndoPE.h"
- #endif
-
- // -- OpenDoc Includes --
-
- #ifndef _ODTYPES_
- #include <ODTypes.h>
- #endif
-
- class ODStorageUnit;
- class ODSession;
- class PanelEditor;
- class CListItem;
- class CList;
- class CUndo;
-
- class CSelection {
-
- public:
- CSelection(PanelEditor* owner, ODSession* session);
- virtual ~CSelection();
-
- void InitSelection();
- void Add(Environment* ev, CListItem* item);
- void Remove(Environment* ev, CListItem* item);
- void Empty(Environment* ev, ODBoolean update = kODTrue);
- ODBoolean IsEmpty();
- void ClearItems(Environment* ev);
- CList* CaptureItems();
- void Activate(Environment* ev, ODFrame* frame, ODBoolean activate);
-
- void Write(Environment* ev, ODStorageUnit* storageUnit);
-
- void Cut(Environment* ev, ODFrame* frame);
- void Copy(Environment* ev, ODFrame* frame);
- void Clear(Environment* ev, ODFrame* frame);
- void ShowPartInfo(Environment* ev, ODFrame* frame);
-
- void PushUndoState(Environment* ev, ODUShort undoType, ODActionType actionType);
- void Undo(Environment* ev, CUndo* action);
- void Redo(Environment* ev, CUndo* action);
-
- ODBoolean CheckForDrag(Environment* ev, ODEventData* event);
- void Drag(Environment* ev, ODFacet* facet, ODEventData* event,
- ODEventInfo* eventInfo);
-
- CListItem* GetFirstItem();
- CListItem* GetLastItem();
-
- //ODBoolean HitTest(Environment* ev, ODFacet* facet);
-
- protected:
- CSelection() {}
-
- private:
- ODBoolean fInited;
- CList* fItems;
- PanelEditor* fOwner;
- ODSession* fSession;
- };
-
- #endif